package com.smart.lx.designPrinciples.carp;

/**
 * 功能描述: <br>
 * 〈生产者〉
 *
 * @since: 1.0.0
 * @Author:abc
 * @Date: 2019/4/6
 */
public class ProductDAO {
    private DbConnection  db;

    public ProductDAO(DbConnection db) {
        this.db = db;
    }

    public void addProduct(){
        System.out.println("使用"+this.db.getConnection()+"编写功能");

    }

    public static void main(String[] args) {
        ProductDAO aa=new ProductDAO(new MysqlConnection());
        aa.addProduct();
    }
}
